package com.it.test;

import com.it.bean.Person;
import com.it.config.MainConfigOfPropertyValues;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class IOCTest_Property {


    @Test
    public void test1() {
        AnnotationConfigApplicationContext app = new AnnotationConfigApplicationContext(MainConfigOfPropertyValues.class);
        System.out.println("容器创建完成");
        String[] beanDefinitionNames = app.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }
        Person bean = app.getBean(Person.class);
        System.out.println(bean);
        app.close();
    }


}
